Imports TeamUp.Negocio

Public Class Facade

    Private Shared objFachada As Facade

    Private Sub New()

    End Sub

    Public Shared Function getInstance() As Facade
        If objFachada Is Nothing Then
            getInstance = New Facade
        Else
            getInstance = objFachada
        End If
    End Function

#Region "Funcionario"
    Public Sub cadastrarFuncionario()
        Dim objNegocio As NeFuncionario = New NeFuncionario(Nothing)
        objNegocio.cadastarFuncionario()
    End Sub
#End Region


#Region "Dependente"
    Public Sub cadastrarDependente()
        Dim objNegocio As NeDependente = New NeDependente(Nothing)
        objNegocio.cadastarDependente()
    End Sub
#End Region


#Region "Usuario"
    Public Function cadastrarUsuario(ByVal strNome As String, ByVal strLogin As String, ByVal strSenha As String, Optional ByVal blnGerarErro As Boolean = False) As Integer
        Dim objNegocio As NeUsuario = New NeUsuario(Nothing)
        cadastrarUsuario = objNegocio.cadastrarUsuario(strNome, strLogin, strSenha, blnGerarErro)
    End Function

    Public Function consultarUsuario(Optional ByVal strCodigo As String = "") As Data.DataSet
        Dim objNegocio As NeUsuario = New NeUsuario(Nothing)
        consultarUsuario = objNegocio.consultarUsuario(strCodigo)
    End Function

    Public Sub alterarUsuario(ByVal strCodigo As String, ByVal strLogin As String, ByVal strNome As String, ByVal strSenha As String)
        Dim objNegocio As NeUsuario = New NeUsuario(Nothing)
        objNegocio.alterarUsuario(strCodigo, strNome, strLogin, strSenha)
    End Sub

    Public Sub excluirUsuario(ByVal strCodigo As String)
        Dim objNegocio As NeUsuario = New NeUsuario(Nothing)
        objNegocio.excluirUsuario(strCodigo)
    End Sub

#End Region

End Class
